package com.hnust.dao;

import com.hnust.domain.Class;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ClassDao {

    //班号获取班级
    @Select("select grade,maj_id,col_id from class where cla_id=#{classId}")
    @ResultType(Class.class)
    Class getClass(String classId);

    //根据学院获取班
    @Select("select * from class where col_id=#{col_id}")
    @ResultType(Class.class)
    List<Class> queryClassByCollageId(String col_id);

    //获取班的年级
    @Select("select grade from class where cla_id=#{cla_id} ")
    String getGradeByClassId(String cla_id);

    //根据专业号获取班
    @Select("select * from class where maj_id=#{maj_id}")
    @ResultType(Class.class)
    List<Class> queryClassByMajorId(String maj_id);

    @Select("select * from class where maj_id=#{majorId}")
    @ResultType(Class.class)
    List<Class> getClassList(String majorId);

}